package com.example.homework4;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;

public class MainActivity extends AppCompatActivity {

    private ImageButton button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        button = (ImageButton) findViewById(R.id.imageButton);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, MainActivity2.class);
                EditText editText=(EditText) findViewById(R.id.editTextPhone);
                EditText editText2=(EditText) findViewById(R.id.editTextTextPassword);
                EditText editText3=(EditText) findViewById(R.id.editTextTextPassword2);
                intent.putExtra("com.example.homework4.editText",editText.getText().toString());
                intent.putExtra("com.example.homework4.editText2",editText2.getText().toString());
                intent.putExtra("com.example.homework4.editText3",editText3.getText().toString());
                startActivity(intent);
            }
        });
    }
        @Override
        protected void onStart() {
            super.onStart();
            Log.d("main", "onStart: ");
        }

        @Override
        protected void onResume() {
            super.onResume();
            Log.d("main", "onResume: ");
        }

        @Override
        protected void onPause() {
            super.onPause();
            Log.d("main", "onPause: ");
        }

        @Override
        protected void onStop() {
            super.onStop();
            Log.d("main", "onStop: ");
        }

        @Override
        protected void onRestart() {
            super.onRestart();
            Log.d("main", "onRestart: ");
        }

        @Override
        protected void onDestroy() {
            super.onDestroy();
            Log.d("main", "onDestroy: ");
        }
}